package com.taobao.api.request;

import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.TmallEaiOrderRefundGoodReturnAgreeResponse;

/**
 * TOP API: tmall.eai.order.refund.good.return.agree request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class TmallEaiOrderRefundGoodReturnAgreeRequest implements TaobaoRequest<TmallEaiOrderRefundGoodReturnAgreeResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 同意退货留言
   */
  private String              message;

  /**
   * 退款单编号
   */
  private Long                refundId;

  /**
   * 售中：onsale 售后：aftersale
   */
  private String              refundPhase;

  /**
   * 退款版本号
   */
  private Long                refundVersion;

  /**
   * 卖家收货地址编号
   */
  private Long                sellerLogisticsAddressId;

  public void setMessage(String message) {
    this.message = message;
  }

  public String getMessage() {
    return this.message;
  }

  public void setRefundId(Long refundId) {
    this.refundId = refundId;
  }

  public Long getRefundId() {
    return this.refundId;
  }

  public void setRefundPhase(String refundPhase) {
    this.refundPhase = refundPhase;
  }

  public String getRefundPhase() {
    return this.refundPhase;
  }

  public void setRefundVersion(Long refundVersion) {
    this.refundVersion = refundVersion;
  }

  public Long getRefundVersion() {
    return this.refundVersion;
  }

  public void setSellerLogisticsAddressId(Long sellerLogisticsAddressId) {
    this.sellerLogisticsAddressId = sellerLogisticsAddressId;
  }

  public Long getSellerLogisticsAddressId() {
    return this.sellerLogisticsAddressId;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "tmall.eai.order.refund.good.return.agree";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("message", this.message);
    txtParams.put("refund_id", this.refundId);
    txtParams.put("refund_phase", this.refundPhase);
    txtParams.put("refund_version", this.refundVersion);
    txtParams.put("seller_logistics_address_id", this.sellerLogisticsAddressId);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<TmallEaiOrderRefundGoodReturnAgreeResponse> getResponseClass() {
    return TmallEaiOrderRefundGoodReturnAgreeResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(message, "message");
    RequestCheckUtils.checkNotEmpty(refundId, "refundId");
    RequestCheckUtils.checkNotEmpty(refundPhase, "refundPhase");
    RequestCheckUtils.checkNotEmpty(refundVersion, "refundVersion");
    RequestCheckUtils.checkNotEmpty(sellerLogisticsAddressId, "sellerLogisticsAddressId");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
